package com.tensquare.friend.dao;

import com.tensquare.friend.pojo.NoFriend;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @author: WangYaWei
 * @description:
 * @create: 2019-08-28 17:03
 **/
public interface NoFriendDao extends JpaRepository<NoFriend, String>, JpaSpecificationExecutor<NoFriend> {

    /**
     * 删除非好友
     * @param userid 用户id
     * @param friendid  好友id
     */
    @Modifying
    @Query("DELETE FROM NoFriend WHERE userid = ?1 AND friendid = ?2")
    void deleteByUseridAndFriendid(String userid, String friendid);
}
